//
//  Movie.m
//  视图控制器
//
//  Created by 18_李明明 on 14-11-17.
//  Copyright (c) 2014年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "Movie.h"
#import "Login.h"
@interface Movie ()

@end

@implementation Movie

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
//    UIImageView *pic = [[UIImageView alloc] initWithFrame:CGRectMake(30, 30, 125, 230)];
////    pic.backgroundColor = [UIColor yellowColor];
//    [self.view addSubview:pic];
////    [pic release];
//    
//    NSString *path = [[NSBundle mainBundle] pathForResource:@"敢死队3" ofType:@"jpeg"];
//    UIImage *image = [UIImage imageWithContentsOfFile:path];
//    pic.image = image;
    // 图片
    NSString *path = [[NSBundle mainBundle] pathForResource:@"敢死队3" ofType:@"jpeg"];
    UIImageView *pic = [[UIImageView alloc] initWithFrame:CGRectMake(30, 30, 125, 230)];
    UIImage *image = [UIImage imageWithContentsOfFile:path];
    pic.image = image;
    [self.view addSubview:pic];
    [pic release];
    
    // 评分
    UILabel *rating = [[UILabel alloc] initWithFrame:CGRectMake(170, 30, 80, 30)];
    rating.text = @"评分: 7.1";
    [self.view addSubview:rating];
    [rating release];
    
    // 评论条数
    UILabel *rating_count = [[UILabel alloc] initWithFrame:CGRectMake(260, 30, 100, 30)];
    rating_count.text = @"(4925评论)";
    [self.view addSubview:rating_count];
    [rating_count release];
    
    // 时间
    UILabel *date = [[UILabel alloc] initWithFrame:CGRectMake(170, 80, 80, 30)];
    date.text = @"20140901";
    [self.view addSubview:date];
    [date release];
    
    // runtime
    UILabel *runtime = [[UILabel alloc] initWithFrame:CGRectMake(170, 130, 80, 30)];
    runtime.text = @"126 min";
    [self.view addSubview:runtime];
    [runtime release];
    
    // genres
    UILabel *genres = [[UILabel alloc] initWithFrame:CGRectMake(170, 180, 150, 30)];
    genres.text = @"动作/冒险/jings";
    [self.view addSubview:genres];
    [genres release];
    
    // country
    UILabel *country = [[UILabel alloc] initWithFrame: CGRectMake(170, 230, 150, 30)];
    country.text = @"美国|法国";
    [self.view addSubview:country];
    [country release];
    
    //actors
    UILabel *actors = [[UILabel alloc] initWithFrame:CGRectMake(30, 280, 80, 40)];
    actors.text = @"制作人";
    actors.font = [UIFont systemFontOfSize:23];
    [self.view addSubview:actors];
    [actors release];
    
    // actors_introduce
    UILabel *actors_introduce = [[UILabel alloc]initWithFrame:CGRectMake(30, 310, 315, 80)];
    actors_introduce.text = @"      西尔维斯特·史泰龙 Sylvester Stallone,杰森·斯坦森 Jason Statham, 梅尔·吉布森 Mel Gibson, 李连杰 Jet Li";
    actors_introduce.numberOfLines = 0;
    [self.view addSubview:actors_introduce];
    [actors_introduce release];
    
    // plot
    UILabel *plot = [[UILabel alloc] initWithFrame:CGRectMake(30, 390, 100, 40)];
    plot.text = @"电影情节";
    plot.font = [UIFont systemFontOfSize:23];
    [self.view addSubview:plot];
    [plot release];
    
//    // plot introduce
    UILabel *plot_introduce = [[UILabel alloc] initWithFrame:CGRectMake(30, 420, 315, 220)];
    plot_introduce.text = @"      在此次第三部的故事中, 巴尼 (史泰龙饰) 与克里斯马斯 (杰森·斯坦森 饰) 领衔的敢死队将正面迎战昔日战友、如今的军火枭雄康拉德·斯通班克斯 (梅尔·吉布森 饰)。斯通班克斯曾侥幸死里逃生过一次,现在他对敢死队下达了绝杀令。巴尼则另有一番打算: 为迎战强敌, 巴尼决定给敢死队注入新鲜血液, 招募了更快更强的高科技战斗新生, 搭配长枪硬炮的硬汉前辈, 展开一番大决战";
    plot_introduce.adjustsFontSizeToFitWidth = YES;
    plot_introduce.numberOfLines = 0;
    [self.view addSubview:plot_introduce];
    [plot_introduce release];
    
    // 创建返回按钮
    UIButton *returnBack = [UIButton buttonWithType:UIButtonTypeSystem];
    [returnBack setTitle:@"返回" forState:UIControlStateNormal];
    returnBack.frame = CGRectMake(30, 637, 30, 30);
    [self.view addSubview:returnBack];
    [returnBack addTarget:self action:@selector(targetReturn:) forControlEvents:UIControlEventTouchUpInside];
}
// 返回按钮事件
- (void)targetReturn:(UIButton *)returnBack
{

    Login *login = [[Login alloc] init];
    [self.parentViewController.view addSubview:login.view];
    [self.parentViewController addChildViewController:login];
    [self.view removeFromSuperview];
    [login release];
//    [self.view addSubview:login.view];
//    [self addChildViewController:login];
//    [login release];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
